package aryn.framework.examples.display;

import java.awt.image.BufferedImage;

import aryn.framework.display.MyCanvas;
import aryn.framework.display.MyFrame;
import aryn.framework.graphic.Load;

public class Example3 {

	/*
	 * Example on mouse over and buttons
	 */
	public static void main(String[] args) throws InterruptedException {
		final MyFrame frame = new MyFrame();
		final MyCanvas canvas = new MyCanvas();
		final LogicMouseOver logic = new LogicMouseOver(canvas);
		canvas.setLogic(logic);
		canvas.setDrawSelection(true);
		frame.addCanvas(canvas);
		frame.setIconImage("imgs/animatedstars.gif");

		BufferedImage[] images = new BufferedImage[4];
		images[0] = Load.bufferedImage("imgs/button0.jpg");
		images[1] = Load.bufferedImage("imgs/button1.jpg");
		images[2] = Load.bufferedImage("imgs/button2.jpg");
		images[3] = Load.bufferedImage("imgs/button3.jpg");

		canvas.addButton("imgs/button0.jpg", 100, 140);
		canvas.addButton(images, 100, 170);
		canvas.addCursor("imgs/cursor01_16x16.png");
		canvas.addCursor("imgs/cursor01_32x32.png");
		canvas.addImage("imgs/sfondoPiante.png", 10, 10);
		canvas.addImage("imgs/sfondoPiante.png", 50, 50);
		canvas.changeCursor(1);
	}
}
